<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('videos', function (Blueprint $table) {
            $table->id();
            $table->string('title')->comment('视频标题');
            $table->string('image')->comment('封面图');
            $table->string('link')->comment('视频链接');
            $table->string('description', 500)->nullable()->comment('视频描述');
            $table->text('content')->nullable()->comment('视频内容');
            $table->json('links')->nullable()->comment('视频附件');
            $table->integer('orderby')->default(0)->comment('排序');
            $table->tinyInteger('hide')->default(0)->comment('是否隐藏');
            $table->integer('readnum')->default(0)->comment('阅读量');
            $table->timestamp('published_at')->default(now())->comment('发布时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('videos');
    }
}
